
var arg

function myFunction(e) {
    // var list = document.getElementsByClassName("div-display")[0];
    html_c_items=document.getElementsByClassName("item_2")
    for(var i=0;i<html_c_items.length;i++){
        html_c_itemStyle=html_c_items[i].getAttribute('style');
        if (html_c_itemStyle==null){
            // alert("if (html_c_itemStyle=='Inline'){");
            html_c_items[i].setAttribute("style","display:none;");
        }
        else if(html_c_itemStyle.includes("display:Inline;")){
            html_c_items[i].setAttribute("style","display:none;");
        }
    }   
    html_c_items=document.getElementsByClassName("item")
    for(var i=0;i<html_c_items.length;i++){
        html_c_itemStyle=html_c_items[i].getAttribute('style');
        if (html_c_itemStyle==null){
            // alert("if (html_c_itemStyle=='Inline'){");
            html_c_items[i].setAttribute("style","display:none;");
        }
        else if(html_c_itemStyle.includes("display:Inline;")){
            html_c_items[i].setAttribute("style","display:none;");
        }
    }  
    const target = event.target;
    const innerHTML = target.innerHTML;
    search_1 = innerHTML.substring(0,innerHTML.lastIndexOf("(")).replaceAll(' ', '_').toUpperCase();
    arg = search_1;
    for (var i = 0; i < document.getElementsByClassName(search_1).length; i++) {
        tartet_element = document.getElementsByClassName(search_1)[i];
        tartet_style = tartet_element.getAttribute("style");

        if(tartet_style==null|| tartet_style.includes("display:none;")){
            document.getElementsByClassName(search_1)[i].setAttribute("style", "display:Inline;");
        }
    }
}

function myFunction2(e) {   
    // var list = document.getElementsByClassName("div-display")[0];
    html_c_items=document.getElementsByClassName("item");
    // console.log(html_c_items[0])
    for(var i=0;i<html_c_items.length;i++){
        html_c_itemStyle=html_c_items[i].getAttribute('style');
        if (html_c_itemStyle==null){
            // alert("if (html_c_itemStyle=='Inline'){");
            html_c_items[i].setAttribute("style","display:none;");
        }
        else if(html_c_itemStyle.includes("display:Inline;")){
            html_c_items[i].setAttribute("style","display:none;");
            // console.log(html_c_items[i]);
        }
    }           
    const target = event.target;
    const innerHTML = target.innerHTML;
    search_2=innerHTML.substring(0,innerHTML.lastIndexOf("(")).replaceAll(' ', '_').toUpperCase();

    console.log("rHTML.lastIndexO"+innerHTML.lastIndexOf("("));      
    console.log("arg:"+arg);      
    console.log("search_2:"+search_2);   
    getclassBySearch_2=document.getElementsByClassName(search_2)
    for (var i = 0; i < getclassBySearch_2.length; i++) {
        getClassBySearch_2=getclassBySearch_2[i].getAttribute("class");
        // console.log(getClassBySearch_2);
        if(getClassBySearch_2.includes(arg)&&getClassBySearch_2.includes(search_2)){
            getclassBySearch_2[i].setAttribute("style", "display:Inline;");
            console.log(getclassBySearch_2[i])
        }

        // tartet_style = tartet_style.replace('null', '')
        
    }
    // for (var i = 0; i < list.getElementsByClassName(innerHTML).length; i++) {
    //     list.getElementsByClassName(innerHTML)[i].setAttribute("style", "display:block")

    // }
    // if (innerHTML == "收起") {
    //     for (var i = 0; i < document.getElementsByClassName("div-display").length; i++) {
    //         document.getElementsByClassName("div-display")[i].setAttribute("class", "div-hidden")
    //     }
    // }
}